/**
 * author:Administrator
 * date:2015/7/27
 * desc:TODO
 */

'use strict';

var Router = require('koa-router');
var config = require('../../../config/config.js');
let daoDispatcher = require('../../../dao/ware.js');

console.log('router:' + config.baseUrl + '/v2/ware');
var router = new Router({
    prefix: config.baseUrl + '/v2/ware'
});
module.exports = router.routes();

/**
 * 添加一个shop
 * post /api/v2/ware/
 {
    "name":"xx",
    "cates":["护肤","手霜"],
    "shopIds":["55c02752329f2fb4042c9582","55c0275f329f2fb4042c9583"],
    "imgUrl": ["https://www.baidu.com/img/bdlogo.png"],
    "price":123,
    "priceMarket":999
 }
 */
router.post('/', function*() {
    let result = yield daoDispatcher.addOne(this.request.inParams);
    this.body = result;
});
